<div class="find-app" id="app">
    <!-- public-head -->
    <div class="header-mobile opacity">
        <a class="nav-back" href="javascript:history.go(-1)">
            <img class="icon" src="__CDN__/assets/img/return-white@2x.png" alt="">
        </a>
        <h1 class="nav-title white">我的钱包</h1>
    </div>
    <div class="main-wrapper">
        <div class="wallet-wrapper">
            <div class="section-floor">
                <div class="wallet-head">
                    <div class="title">我的余额</div>
                    <div class="inner-wrapper">
                        <div class="price">{$user.money}</div>
                        <div><a class="btn" href="{:url('user/postal')}">提现</a><a class="btn"
                                href="{:url('user/postallog')}">提现记录</a></div>
                    </div>
                </div>
            </div>
            <div class="section-floor">
                <div class="wallet-title">
                    收入明细
                </div>
            </div>
            <div class="section-floor">
                <div v-infinite-scroll="loadMore" infinite-scroll-disabled="loading" infinite-scroll-distance="20"
                    class="wallet-list">
                    <div v-for="(item,index) in list" :key='index' class="wallet-list">

                        <div class="list-item">
                            <div>
                                <p class="p1">{{item.title}}
                                    <img v-if="item.type == 6" class="icon" src="__CDN__/assets/img/Shape@2x.png">
                                </p>
                                <p class="p2">{{item.content}}<span class="mark">{{item.something.content}}</span>的收益
                                </p>
                                <p class="p3">{{item.createtime}}</p>
                            </div>
                            <div class="price"><span class="symbol">+</span>{{item.money}}元</div>
                        </div>

                    </div>

                </div>
            </div>
            <div class="loading-wrapper">
                <mt-spinner v-if="loading" color="#4FA7FF" :type="3"></mt-spinner>
            </div>
        </div>
    </div>
</div>

<script>
    let index = new Vue({
        el: '#app',
        data: {
            list: [],
            loading: false,
            postData: {
                page: 1,
                limit: 10
            }
        },
        created() {
            // this.jumpDomain = "{:url('index/detail')}"
        },
        mounted() {
            // this.ajax()
            // this.wrapperHeight = document.documentElement.clientHeight - this.$refs.wrapper.getBoundingClientRect().top;
        },
        methods: {
            navChange() {

            },
            loadMore() {
                this.ajax()
                this.loading = false
            },
            ajax() {
                let self = this
                this.loading = true
                axios({
                    method: "post",
                    url: "{:url('user/withdrawals')}",
                    data: this.postData,
                    headers: {
                        'X-Requested-With': 'XMLHttpRequest'
                    }
                }).then(res => {
                    if (res.data.code == 1) {
                        console.log(res.data.data)
                        self.list = self.list.concat(res.data.data)
                        self.postData.page++
                        self.loading = false
                    }
                })
            }
        }
    })
</script>